<?php

/*
	A recursive approach to reverse a linked list.
*/

require_once 'util.php';

$arr = generateRandomArray(1, 100, 5);

$head = null;
$cur = &$head;
foreach( $arr as $value ){
	$cur = new CLLNode( $value );
	$cur = &$cur->next;
}

echo "The list:<br/>";
echo ll_implode( $head );
echo "<br/>";

ll_merge_sort( $head );

echo "After:<br/>";
echo ll_implode( $head );


